]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Explicitly set the width and height for subicons' containers in folders
authorMario Sanchez Prada <mario@endlessm.com>
Fri, 11 Aug 2017 09:04:37 +0000 (11:04 +0200)
committerMario Sanchez Prada <mario@endlessm.com>
Fri, 11 Aug 2017 10:47:45 +0000 (12:47 +0200)
Otherwise the smaller icons will try to take too much space since the
texture rendering the icons will be scaled up on HiDPI displays according
to the scale factor, which will push the size of the StBin containing the
texture up, causing them to completely fill the folder's total space.

Explicitly setting the size of the StBin container in this case, in a
similar fashion to what we do when creating the empty placeholders (in
case where there are less than 4 apps in a folder), ensures that each
"cell" of the grid-like widget representing the folder does not take
too much space.

https://bugzilla.gnome.org/show_bug.cgi?id=786145

js/ui/appDisplay.js

index 1cb8303724ac4ca44b9db1b9cf9de1deb0c0b3fb..428b3c062dea5b38cc6139a0a5611109673b21f9 100644 (file)
@@ -1172,13 +1172,9 @@ var FolderView = new Lang.Class({
         let numItems = this._allItems.length;
         let rtl = icon.get_text_direction() == Clutter.TextDirection.RTL;
         for (let i = 0; i < 4; i++) {
-            let bin;
-            if (i < numItems) {
-                let texture = this._allItems[i].app.create_icon_texture(subSize);
-                bin = new St.Bin({ child: texture });
-            } else {
-                bin = new St.Bin({ width: subSize, height: subSize });
-            }
+            let bin = new St.Bin({ width: subSize, height: subSize });
+            if (i < numItems)
+                bin.child = this._allItems[i].app.create_icon_texture(subSize);
             layout.attach(bin, rtl ? (i + 1) % 2 : i % 2, Math.floor(i / 2), 1, 1);
         }